package com.ybkj.daijia.aop;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ybkj.daijia.api.common.AesUtil;
import com.ybkj.daijia.page.Page;
import com.ybkj.daijia.page.encrypt.PageEnc;
import java.lang.reflect.Field;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

@Aspect
@Component
public class EncryptAop {

    private final static Logger logger = LoggerFactory.getLogger(EncryptAop.class);

    private static ObjectMapper mapper = new ObjectMapper();

    public static void main(String[] args) {
        String s = AesUtil.aesDecrypt(
            "yn9F3iIxTV/aYLc85uBljXtmgLFwzo66DXrTuZBoPVrR10dc2r/i1ty4T+ZnqP8LCCLvNj+FfNEtRe3osQPKy1Fejmt6kD3jNVnKPvTgxYDNwux8FMbd7vnHtAr9k95NEnPUrbeQy7Zje37Lj+Pfiv0XNFMUHs7V0CwSEWMJsSqbamZrPwSPBxFtosnjHycOi5tBjzVi/hZDkKtm+x57fgbYzSV5QvBqwuVt+MTZ0t9p6skzuP4NQnPT8DZQOTkK2t5hzbacuWnt31UVoo+g9DqnU94YxGl4bxWvajkQJQqjnPUmVlIwHfmuO7ERQn8BbCQdxUI29ofOOZ4eGXV3I1xSyl8/ilfv2tOw4L+SzioyoeojVjHMjg6Z/fTMdrfUnH2+cVBqj6voWyYO8avi4tA6zSSbEWiNiv0q5hoeKikqqB+i2Nc4SvnRmdfANg4tmf9NsTxWg2vdtoW4q76lsJLIpz08Fy7THViUU8LwksEU4S8z9QV5GnJ17AZC85NZt5MITl01ly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bwZTmkvf7Ae3ycsl1HCk5Dk6EVzOXQ+fTiH7hd60XGkDAzlkiv3sPMD+WQ7epKB8ECVnyw42l2Iqf57s30fkAKzBRp0Aof+01tTqzEhhSGpC6a9GVoVm8LwXurfZjwRFXUFURRN+hTO/s7ix1ycs2rBlg4A6unhGsxfxdAGUmBv59bxB8uxrRhDvpjtBFCbw2rfKhdrVWANMd63qBxghNMusM8tYhtWp/lUxDHbEztCz4yQkag2HGoUT/3mqvgMzerkcKqpG8vJn5RvQDfGnZyVKxMF7CTDaoIF0CuB84nLP9aoseAnt1bkntrwr3ARn26j9NYYmtHGIrnYvZ+qkU49y066f4Dti2+jBwzk8U6XO3bUsCF+AjLNoaHvooGhosTpq2DUA+pDHMsPB8jumuqwRbEsTvQdUKuVP29o+VBpXDFhj6SkJyJW5a8uqRquKrj+lBb9nPQTqJxS0EZWLOTMlce19SN0JH/Du+5+yHjdp7IJHNuKJTkJNnGeQZC93N3dfOGrRYyPwuciDMWlbEiEJkWODuQZ+mugoMo/49gaRYhhjpZ0in07MgnA41YE6MBmzKhW3paaNaZMWF8zYIhUOq0VtDCXGysSm6mdIdD4USmxSraQu7Gi6h+8QBzLhlCv8f5UCt/bSvcO2TElpwKp0o4Ud8Evtl2gs9PBN1MqykM1zExBL2coSt9fCjgxg1vzDRvRVOYQQHHB2lIY8PVe69xJimxo1EkgmNvA5SuJtrk9XR2Q+ZpNDFTOjn0skZaHi+LyAVbmSwQ3JWV7R/NKNY7e5S2P41jpmVcKGTSRphIqgRpH/f68lI4pCD02/ceB+Jnho+SW+aNnEt5z1",
            AesUtil.VIPARA);
        System.out.println(s);
    }

    //	@Pointcut("execution(public * LogController.*(..))")
    @Pointcut("execution(public * com.ybkj.daijia.api.driver.*.*.*(..)) " +
        "&& !execution(public * com.ybkj.daijia.api.driver.v4.LocationController.updateUserLocation(..))"
//          + "&& !execution(public * com.ybkj.daijia.api.driver.v4.ProcessController.indexOrders(..))"
    )
    public void pointCutApiDriver() {
    }

    @Pointcut("execution(public * com.ybkj.daijia.api.driver.*.*(..)) ")
    public void pointCutApiDriverA() {
    }

    @Pointcut("execution(public * com.ybkj.daijia.api.member.*.*.*(..))")
    public void pointCutApiMember() {

    }

    @Pointcut("execution(public * com.ybkj.daijia.server.controller.DriverRebatePaymentRecordController.queryDriverRebate(..))")
    public void pointCutRebate() {

    }

    @Pointcut("execution(public * com.ybkj.daijia.api.apirest.*.*(..)) && !execution(* com.ybkj.daijia.api.apirest.SystemProcessController.getTimestamp(..)) "
//          + "&& !execution(public * com.ybkj.daijia.api.apirest.ZhuancheProcessController.findOne(..))"
    )
    public void pointCutApirest() {

    }

    @Pointcut("execution(public * com.ybkj.daijia.api.apirest.*.*.*(..))"
//          + "&& !execution(public * com.ybkj.daijia.api.apirest.v4.ZhuancheProcessController.getZhuanPrice(..))"
//          + "&& !execution(public * com.ybkj.daijia.api.apirest.v4.ZhuancheProcessController.employeUploadKuaiPrice(..))"
        + "&& !execution(public * com.ybkj.daijia.api.apirest.v4.ZhuancheProcessController.passengerUploadLocation(..))"
    )
    public void pointCutApirestV4() {

    }

    @Pointcut("execution(public * com.ybkj.daijia.api.common.v4up.*.*(..))")
    public void pointCutApiCommonV4up() {

    }

    @Around("pointCutApiDriver()||pointCutApiMember()||pointCutApirest()||pointCutApirestV4()||pointCutApiCommonV4up()||pointCutRebate()||pointCutApiDriverA()")
    public Object pointCutApiDriver(ProceedingJoinPoint thisJoinPoint) throws Throwable {
        RequestAttributes ra = RequestContextHolder.getRequestAttributes();
        ServletRequestAttributes sra = (ServletRequestAttributes) ra;
        HttpServletRequest request = sra.getRequest();
        Object[] args = thisJoinPoint.getArgs();
        StringBuilder sb = new StringBuilder("[");
        for (Object arg : args) {
            if (arg == null) {
                sb.append("null,");
                continue;
            }
            if (arg.toString().length() > 200) {
                sb.append(", ");
                continue;
            }
            sb.append(arg.toString() + ", ");
        }
        sb.setCharAt(sb.length() - 1, ']');
        logger.info("URL:{} |METHOD:{} |REQ: {} ", request.getRequestURL().toString(),
            request.getMethod(), sb.toString());
        String x_type = request.getHeader("X-type");
        return dataHandle(x_type, thisJoinPoint);

    }

    private Object dataHandle(String x_type, ProceedingJoinPoint thisJoinPoint) throws Throwable {

        Object args[] = thisJoinPoint.getArgs();
        if (StringUtils.isNotBlank(x_type) && x_type.equals("sign")) {
            long start = System.currentTimeMillis();
            Object obj = thisJoinPoint.proceed(args);
            long cost = System.currentTimeMillis() - start;
            logger.info("Time: {} , RESPONSE : {}", cost, JSON.toJSONString(obj));
            if (obj instanceof com.ybkj.daijia.api.member.transport.ResultTransport) {
                com.ybkj.daijia.api.member.transport.ResultTransport result = (com.ybkj.daijia.api.member.transport.ResultTransport) obj;
                Object data = result.getData();
                if (null != data) {
                    if (data instanceof Page) {
                        Page<Object> page = (Page<Object>) data;
                        PageEnc<Object> pageEnc = new PageEnc<Object>(page);
                        result.setData(
                            AesUtil.aesEncrypt(mapper.writeValueAsString(pageEnc), AesUtil.VIPARA));
                        return result;
                    } else {
                        result.setData(
                            AesUtil.aesEncrypt(mapper.writeValueAsString(data), AesUtil.VIPARA));
                        return result;
                    }
                } else {
                    return obj;
                }
            } else if (obj instanceof com.ybkj.daijia.api.driver.transport.ResultTransport) {
                com.ybkj.daijia.api.driver.transport.ResultTransport result = (com.ybkj.daijia.api.driver.transport.ResultTransport) obj;
                Object data = result.getData();
                if (null != data) {
                    if (data instanceof Page) {
                        Page<Object> page = (Page<Object>) data;
                        PageEnc<Object> pageEnc = new PageEnc<Object>(page);
                        result.setData(
                            AesUtil.aesEncrypt(mapper.writeValueAsString(pageEnc), AesUtil.VIPARA));
                        return result;
                    } else {
                        if (data instanceof Map) {
                            Map<String, Object> map = (Map<String, Object>) data;
                            if (null != map.get("notice")) {
                                Page<Object> page = (Page<Object>) map.get("notice");
                                PageEnc<Object> pageEnc = new PageEnc<Object>(page);
                                map.put("notice", pageEnc);
                                result.setData(AesUtil
                                    .aesEncrypt(mapper.writeValueAsString(map), AesUtil.VIPARA));
                                return result;
                            } else {
                                result.setData(AesUtil
                                    .aesEncrypt(mapper.writeValueAsString(data), AesUtil.VIPARA));
                                return result;
                            }
                        } else {
                            result.setData(AesUtil
                                .aesEncrypt(mapper.writeValueAsString(data), AesUtil.VIPARA));
                            return result;
                        }
                    }
                } else {
                    return obj;
                }
            } else if (obj instanceof com.ybkj.daijia.api.util.ResultTransport) {
                com.ybkj.daijia.api.util.ResultTransport result = (com.ybkj.daijia.api.util.ResultTransport) obj;
                Object data = result.getData();
                if (null != data) {
                    if (data instanceof Page) {
                        Page<Object> page = (Page<Object>) data;
                        PageEnc<Object> pageEnc = new PageEnc<Object>(page);
                        result.setData(
                            AesUtil.aesEncrypt(mapper.writeValueAsString(pageEnc), AesUtil.VIPARA));
                        return result;
                    } else {
                        result.setData(
                            AesUtil.aesEncrypt(mapper.writeValueAsString(data), AesUtil.VIPARA));
                        return result;
                    }
                } else {
                    return obj;
                }
            } else if (obj instanceof Map) {
                @SuppressWarnings("unchecked")
                Map<String, Object> map = (Map<String, Object>) obj;

                Object code = map.get("code");
                Object data = map.get("data");
                Object success = map.get("success");

                if (null != success) {

                    if (null != data) {
                        map.put("data",
                            AesUtil.aesEncrypt(mapper.writeValueAsString(data), AesUtil.VIPARA));
                        return map;
                    } else {
                        Iterator<Entry<String, Object>> it = map.entrySet().iterator();
                        while (it.hasNext()) {
                            Entry<String, Object> itEntry = it.next();
                            Object itKey = itEntry.getKey();
                            Object itValue = itEntry.getValue();
                            if (!String.valueOf(itKey).equals("success")) {
                                if (null != itValue) {
                                    itEntry.setValue(AesUtil
                                        .aesEncrypt(String.valueOf(itValue), AesUtil.VIPARA));
                                }
                            }
                        }
                        return map;
                    }

                } else if (null != code) {
                    if (null != data) {
                        map.put("data",
                            AesUtil.aesEncrypt(mapper.writeValueAsString(data), AesUtil.VIPARA));
                        return map;
                    } else {
                        return obj;
                    }
                } else {
                    return obj;
                }
            } else {
                try {
                    Field field = obj.getClass().getDeclaredField("data");
                    field.setAccessible(true);
                    Object value = field.get(obj);
                    if (value == null) {
                        return obj;
                    }
                    field.set(obj,
                        AesUtil.aesEncrypt(mapper.writeValueAsString(value), AesUtil.VIPARA));
                } catch (NoSuchFieldException e) {
                    e.printStackTrace();
                }
                return obj;
            }
        } else {
            long start = System.currentTimeMillis();
            Object obj = thisJoinPoint.proceed(args);
            long cost = System.currentTimeMillis() - start;
            logger.info("Time: {} , RESPONSE : {}", cost, JSON.toJSONString(obj));
            return obj;
        }
    }
}
